package org.eenie.kdassistant.utils;

import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;


/**
 * Created by Eenie on 2017/7/31.
 * Email: eeniework@gmail.com
 * Des:
 */

public class ApplicationUtil {

    public static void openXingZhe(Context context) {
        Intent intent = new Intent();
        intent.putExtra("SkipQRCode", 11);
        intent.setComponent(new ComponentName("com.yto.receivesend", "com.yto.walker.activity.QrcodeSignInActivity"));
//        intent.setAction(Intent.ACTION_VIEW);
        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent);
    }

    public static void openST(Context context) {
        Intent intent = new Intent();
        intent.setComponent(new ComponentName("com.kuaibao.skuaidi", "com.kuaibao.skuaidi.sto.etrhee.activity.EThreeSysMainActivity"));
//        intent.setComponent(new ComponentName("com.kuaibao.skuaidi", "com.kuaibao.skuaidi.sto.etrhee.activity.ZTPieActivity"));
//        intent.setAction(Intent.ACTION_VIEW);
        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent);
    }


    public static void openST_DJ(Context context) {
        Intent intent = new Intent();
        intent.setComponent(new ComponentName("com.kuaibao.skuaidi", "com.kuaibao.skuaidi.sto.etrhee.activity.EthreeInfoScanActivity"));
        intent.putExtra("scanType", "扫到件");
        intent.putExtra("byScanner", true);

//        intent.setComponent(new ComponentName("com.kuaibao.skuaidi", "com.kuaibao.skuaidi.sto.etrhee.activity.ZTPieActivity"));
//        intent.setAction(Intent.ACTION_VIEW);
        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent);
    }


    public static void openZZT(Context context) {
        Intent intent = new Intent();
        intent.setComponent(new ComponentName("com.geenk.zto.sys", "com.zto.ztohand.mvp.other.ui.activity.delivery.DeliveryActivity"));
//        intent.setAction(Intent.ACTION_VIEW);
        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent);
    }

    public static void back(Context context) {
        Intent intent = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName());
//        intent.setAction(Intent.ACTION_VIEW);
        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent);
    }

}
